//package com.plian.system.controller.hr.recruitment;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.config.Resubmit;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.ObjResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.search.TokenSearch;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.hr.recruitment.IRemovalManagementService;
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.*;
//
//import javax.validation.Valid;
//import java.util.List;
//
///**
// *  控制器
// *
// * @author BladeX
// * @since 2019-12-03
// */
//@Slf4j
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/removalmanagement")
//public class RemovalManagementController extends BaseController {
//
//	private IRemovalManagementService removalManagementService;
//
////	private RemovalManagementWrapper removalManagementWrapper;
//
//    /**
//    * 详情
//    */
//	@PostMapping("/detail")
//	public R<RemovalManagementVO> detail(@RequestBody RemovalManagement removalManagement) {
//		RemovalManagement detail = removalManagementService.getOne(Condition.getQueryWrapper(removalManagement));
//		RemovalManagementVO removalManagementVO = removalManagementWrapper.entityToVO(detail);
//		return R.data(removalManagementVO);
//	}
//
//	/**
//	* 分页
//	*/
//	@PostMapping("/list")
//	public ListResult<RemovalManagementVO> list(@Valid @RequestBody Query query) {
//		if(query.getAscs()==null&&query.getDescs()==null){
//			query.setDescs("create_time");
//		}
//		List<SearchEntity> entityList = query.getSearch();
//		QueryWrapper<RemovalManagement> queryWrapper = SearchParamEntiy.getQueryWrapper(
//				Condition.getQueryWrapper(new RemovalManagement()), entityList
//		);
//		TokenSearch<RemovalManagement> tokenSearch = new TokenSearch<>();
//		tokenSearch.addTokenQuery(queryWrapper, query);
//		IPage<RemovalManagement> pages = removalManagementService.page(Condition.getPage(query), queryWrapper);
//		List<RemovalManagementVO> removalManagementVOS = removalManagementWrapper.entityToVO(pages.getRecords());
//		ListResult<RemovalManagementVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//		listResult.setList(removalManagementVOS);
//		listResult.setTotal(Long.valueOf(pages.getTotal()).intValue());
//		return listResult;
//	}
//
//	/**
//	* 新增或修改
//	*/
//	@PostMapping("/submit")
//	@Resubmit(delaySeconds = 0)
//	public R submit(@Valid @RequestBody RemovalManagement removalManagement) {
//		return removalManagementService.submit(removalManagement)
//				? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//	}
//
//	/**
//	 * 变更
//	 */
//	@PostMapping("/change")
//	public R change(@Valid @RequestBody RemovalManagement removalManagement) {
//		return removalManagementService.change(removalManagement)
//				? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//	}
//
//	/**
//	* 删除
//	*/
//	@PostMapping("/remove")
//	public R remove(@RequestBody PageData pd) {
//		List<String> ids = (List<String>)pd.get("ids");
//		return removalManagementService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//				? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//	}
//
//    /**
//     * 弃审
//     */
//    @PostMapping("/cancel")
//    public ObjResult cancel(@RequestParam Long id) {
//        return removalManagementService.cancel(id)
//				? new ObjResult(CommonCode.SUCCESS) : new ObjResult(CommonCode.FAIL);
//	}
//
//}
